package com.wyz.note.project.engine.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.wyz.note.project.common.pojo.UserInfo;
import com.wyz.note.project.common.service.UserInfoService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description:
 * @Author: wei yz
 * @Date: 2022/6/30 16:40
 */
@RestController
@RequestMapping("/api/user")
public class UserController {

    @Autowired
    @Reference
    private UserInfoService userService;

    @GetMapping("/list")
    public IPage<UserInfo> userInfo(Integer pageNum, Integer pageSize) {
        return userService.getList(pageNum,pageSize);
    }
    /**
     * 测试流控规则
     */
    @PostMapping("/testFlow")
    public UserInfo testFlow() {
        UserInfo user = userService.getById("P00001fd6c8134ee998d5fd3ac8868a2b");
        return user;
    }
}
